package com.whxd.smarthome.api.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @author 张世鹏
 *
 */
@Entity
@Table(name = "api_version")
public class Version {

	public static final String CLIENT_ANDROID = "android";
	public static final String CLIENT_IOS = "ios";

	/*--------------------------------------------------
	 * 属性
	 * -----------------------------------------------*/

	/*--------------------------------------------------
	 * 属性
	 * -----------------------------------------------*/
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(nullable = false)
	private Long id;

	@Column(nullable = false)
	private int version;

	@Column(nullable = false)
	private String name;

	@Column(nullable = false)
	private String path;

	@Column(nullable = false, unique = true)
	// 每种客户端保留一个记录
	private String client;

	/*--------------------------------------------------
	 * Setter/Getter
	 * -----------------------------------------------*/
	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getClient() {
		return client;
	}

	public void setClient(String client) {
		this.client = client;
	}

}
